﻿using System;
using System.Data;
using System.Web.Caching;
using System.Reflection;
using DotNetNuke;
using DotNetNuke.Common;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Services.Localization;


namespace gdlmo.DNN.Modules.Category.Data
{
	public abstract class DataProvider
	{
		#region Shared/Static Methods
        // singleton reference to the instantiated object 
		private static DataProvider objProvider = null;

		// constructor
		static DataProvider()
		{
			CreateProvider();
		}

		// dynamically create provider
		private static void CreateProvider()
		{
			objProvider = ((DataProvider)DotNetNuke.Framework.Reflection.CreateObject("data", "gdlmo.DNN.Modules.Category.Data", "gdlmo.DNN.Modules.Category"));
		}

		// return the provider
		public static DataProvider Instance()
		{
			return objProvider;
		}

		#endregion
		#region "Category Abstract Methods"
		public abstract IDataReader GetCategory(int CategoryID,int moduleId);
		public abstract IDataReader ListCategory();
		public abstract IDataReader GetCategoryByModules(int ModuleID );
		public abstract int AddCategory(int ModuleID , string Name , string Description , int ParentID , int Depth , int ViewOrder , string AdminRoles , string EditRoles , string ViewRoles , string CreatedByUser , DateTime CreatedDate , bool IsActive);
		public abstract void UpdateCategory(int CategoryID, int ModuleID , string Name , string Description , int ParentID , int Depth , int ViewOrder , string AdminRoles , string EditRoles , string ViewRoles , string CreatedByUser , DateTime CreatedDate , bool IsActive);
		public abstract void DeleteCategory(int CategoryID);
		#endregion
	}
}

